#encoding:utf-8

j=1
while j<=9:
	i=1
	while i<=j:
		print("{}*{}={:<4}".format(i,j,j*i),end=" ")
		i+=1
	print("")
	j+=1
print("="*80)
x=9
while x>=1:
	y=1
	while y<=x:
		print("{}*{}={:<4}".format(y,x,x*y),end=" ")
		y+=1
	print("")
	x -= 1

print("="*80)

i=1
while i<=9:
	k=1
	while k<=9-i:
		print(end=" "*9)
		k+=1
	j=i
	while 1<=j:
		print("{}*{}={:<4}".format(j,i,j*i),end=" ")
		j-=1
	print("")	
	i+=1
print("="*80)
a=9
while a>=1:
	b=1
	while b<=9-a:
		print(end=" "*9)
		b+=1
	c=a
	while c>=1:
		print("{}*{}={:<4}".format(c,a,a*c),end=" ")
		c-=1
	print("")
	a-=1

